<template>
  <!-- <div class="hello">11111</div> -->
  <div class="main">
    <div class="left">
      <div>
        <router-link
          v-for="(route, index) in sidebarRouters"
          :key="route.path + index"
          :to="route.path"
          >{{ route.name }}</router-link
        >
      </div>
    </div>
    <div class="right">
      <div class="top"></div>
      <router-view />
    </div>
  </div>
</template>

<script>
import { routes } from '../router'
export default {
  name: 'LayoutView',
  props: {
    msg: String
  },
  computed: {
    sidebarRouters() {
      return routes
    }
  },
  mounted() {
    console.log(this.sidebarRouters)
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.main {
  width: 100%;
  height: 100%;
  background-color: red;
  display: flex;
  .left {
    width: 200px;
    background-color: #fff;
  }
  .right {
    background-color: pink;
    flex: 1;
    .top {
      height: 100px;
      background-color: blue;
    }
  }
}
</style>
